package com.project.forum.services;

import com.project.forum.model.Message;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:DELL
 * Time:22:19
 */
public interface IMessageService {
    //发送站内信
    void create(Message message);

    //根据id查询站内信
    Message selectById(Long id);

    //根据用户id查询该用户未读的数量
    Integer selectUnreadCount(Long receiveUserId);

    //根据接受者的用户id查询所有站内信
    List<Message> selectByReceiveUserId(Long receiveUserId);

    //更新指定站内信的状态
    void updateStateById(Long id,Byte state);

    //回复站内信
    @Transactional
    void reply (Long repliedId, Message message);
}
